home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
By Popular Request 2.0
/
By Popular Request 2.0 (Arsenal Computer).ISO
/
amiga_4
/
logsts34.lha
/
Logstats.doc
< prev
next >
Wrap
Text File
|
1994-12-09
|
42KB
|
1,072 lines
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
The LogStats Package
(Version 3.3 was 07-Nov-91)
Version 3.4 - 09-Dec-94
This version is in GFA-BASIC
compiler version 3.51E
Another Metro Utility from Peter Deane
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
----------------------------------------------------------------------------
Copyright Status:
----------------------------------------------------------------------------
The copyright as a Metro Utility is held by me. This package may be
re-distributed electronically, provided a profit is not made by such
distribution. If a profit is made, then the proceeds MUST be forwarded
to me.
This package used to be shareware with a 30 day evaluation period and a
$5 registration fee. I'll waive the requirement for the fee to be paid,
however, I WOULD appreciate some support for what is, after all, a very
handy utility for your BBS. If you want to send me money, flowers,
chocolates or beer (forget it, just send the money, I'm overweight as it
is, the flowers will die, and I'm a teatotaller) feel free. In fact,
feel obligated.
----------------------------------------------------------------------------
Contact Me:
----------------------------------------------------------------------------
Peter Deane
FidoNet: 3:622/401 Postal: PO Box 228
GlobalNet: 54:6101/401 Swansea NSW 2281
AmigaNet: 41:200/401 AUSTRALIA
Or call the BBS: from O/S +61-49-72-1647
(24 hrs) from Aust (049) 72-1647
----------------------------------------------------------------------------
What Does It Do?
----------------------------------------------------------------------------
The Logstats Package consists of three programs: Logstats, which must
be run in every midnight event to collate the stats and produce a data
file; StatDoor, which is the door that is run on your BBS to present the
data items in a meaningful way; and the LogstatsEd, which is used for
generating a blank Logstats file, and for maintenance on the stats
themselves, once you've been running it for a while.
Stats are collected for these BBS activities:
* Calls
* Public Messages
* Private Messages
* Downloads
* Uploads
* Door Entrances
The door then allows one to access the file and get reports printed
based on the top 15 users in each category, overall unsorted figures for
each category, ratios of each category per call, Public Messages per
Private Message, Uploads per Download, Downloads per Upload, any
individual user's figures, a full database display of all statistics and
a Top 50 Users Chart. (Go into the door and check it out if that was
confusing)
The door has full ANSI graphics, plenty of IBM graphics characters and
fully hot-keyed selections.
All versions of the Stats Door are completely compatible with the same
data file - viz. BBS:BBSFILES/logstats
----------------------------------------------------------------------------
Revision Notes:
----------------------------------------------------------------------------
This door has seen quite a few revisions since its first inception as my
third Metro door. Conversion from one version to another is NOT a
headache. Please read these notes if you are going from one version to
another.
If you're setting up LogStats for the first time, skip to the next
section entitled "Files in the archive". Don't get confused by the
following info for revision upgrades. I've left it in these docs mainly
for historical purposes.
Version 3.3 --> 3.4
-------------------
This is a new version over three years since the last one, released
especially for the OzMetro BBS package. This one no longer reads the
s:Metro.config file (preferring the OzMetro s:Metro.cfg file instead),
automates removal of the old log file, and adds a "Records for this BBS"
function added originally by Phillip Eastham to my (personal) version,
but I lost the source for it. The implementation is the same as Phill's
to be backwards compatible, but the code is now mine. I wonder how
similar it would be?
The door now ALWAYS comes to the front and makes itself active when run
from the BBS. Not enough time for a keyword. Later...
Users of the OLD 3.3 version of LogStats should re-do the script that
runs LogStats. The removal of the old log is now done by the program
itself, so any old "cat" commands will have to be removed from your
scripts. It means a big streamlining of things, so please read the
section in these docs outlining the midnight script.
Also fixed a bug in the LogstatsED program where hiuser and oldhiuser
numbers are different (fixed in the door and the logstats program back
in V 3.3 - but not the editor).
Version 3.2 --> 3.3
-------------------
A bug was fixed in the door where if your hiuser and oldhiuser numbers
were different, the door would bomb out while trying to read in the
stats figures (well the last non-existant figure, anyway)!
By the way, I forgot to change the version number and date in the new
door program when I sent the StatDoor33 update revision off to the USA.
It still reports V 3.2. The door in THIS archive is the same, but has
the correct date and version number.
The real way to tell 3.2 & 3.3 apart is that when loading the figures,
3.2 will say 'We have XXX users on the system', and 3.3 will add after
it 'We have stats on XXX of them.' You have to be quick to catch it if
you only have 100 or so users - it loads pretty damn quick. So if your
door says 'We have stats on XXX of them', it's 3.3 for sure!
A new feature was added to the midnight generator program to get a
'Yesterday on this BBS' summary of the day's activities which you can
easily put up as a textfile. See the section on the midnight generator
program (ie Logstats.run) to see how to do this.
The editor is still version 3.2. No changes needed (or found - I don't
use this all that much, you know).
Version 3.0 --> 3.2
-------------------
This release has new executables for all three components.
The Editor/Generator (LogstatsEd) has been completely re-written in
GFA-BASIC and now is amiga-tised complete with menus and requestors and
the like. Please use it, it's so much faster and more reliable than the
old one in AC-BASIC. Besides, it's a lot easier to use!
The door has been updated ever so slightly. What I did was have a good
look at how it would be running on an NTSC system (640*200) and scored a
few extra display lines in a couple of places. The door will also open
differently. If the caller is a local login, the screen is pushed to
the front and the window activated. If, however, a remote caller enters
the door, the only sign you'll get is a very small flash on your local
console. The window is NOT made active - so you can keep working at
what you're doing without a mad rush for the mouse - and the screen is
quickly pushed to the very rear. To access the door when a remote user
is online, simply click your screen gadgets to bring StatDoor forward
and activate the window by clicking in it.
The door now has error-checking. It doesn't do much, and doesn't even
record what happened, but simply quits the user back to the BBS. I
haven't had an error from the door since I started running it almost 9
months ago now, but I did write it, and I know how to set it up. This
is just a fail-safe mechanism, which I could only test by renaming a few
key files, thus intentionally bringing it down. I also tested every
function with a completely blank data file (all users back to zero). I
think V 2.0 would have caused problems for users who did not have an
existing stats file with 15 top users in EVERY category. Anyway, this
will work for sure, even if you're setting it up for the first time.
The midnight statistician (Logstats.run) now does not open a window of
its own. It prints out all the information to the calling CLI window.
The BIG change with this one is the error-checking, which makes it
extremely robust. I check for EVERY file it needs, and if a file cannot
be found, a DETAILED report which will be found in the BBSFILES
directory as 'Logstats.errors' will tell you what the problem is. I'll
include further info about this later in the docs.
So, simply replace your three executables with the new ones. You'll be
so glad you did!
Version 2.0 or 2.6 --> 3.0
--------------------------
This is THE version you've been waiting for. It's in GFA-BASIC, and the
speed increase is absolutely incredible! No longer is it a pain-in-the
neck to load in the data file. On my system (225 users) it takes about
3/4 second!
What you now DON'T need:
~~~~~~~~~~~~~~~~~~~~~~~
* Any run-library you may have
* Any .bmap file
* Any menu file
* The file BBSFILES/logstats.start
(Naturally OTHER doors may need the run libraries and .bmap files, so
don't delete them. You can do away with logstats.start, however but you
must add this to the config file...)
What you need to do:
~~~~~~~~~~~~~~~~~~~~
* You will need to replace the door itself.
* The midnight stats gatherer program, logstats.run SHOULD be replaced.
The old version will still work fine, but I think you'll find the GFA
version is a LOT faster, and doesn't store unnecessary spaces in the
data file, reducing its size by about 25%.
* You'll need to add 1 extra line to the statdoor.config file. Load up
the config into a text editor, and straight after the last line, type in
the date you started running logstats. The date can be up to 19
characters long - any longer and it will be truncated to the first 19
characters.
(After the starting date, you may like to press return a few times to
make sure you don't get an 'End Of File' error. If you are running the
door without making this change to the config file, it will crash with
an 'End-of-File' error very early on in the piece).
Changes in this version:
~~~~~~~~~~~~~~~~~~~~~~~
It will open a screen the same size as your Metro screen (getting the
values from your s:metro.config file). This means if you have a PAL
amiga, it will open a PAL screen. It may also mean an NTSC amiga will
not quite fit the 'Top 15' users on the screen at once, but you'll live.
(I haven't checked this, but I remember it only just fitted into the
AC-BASIC screen). You won't be missing much locally, and it WILL fit on
a 24 line terminal with no problems, so the USERS will be happy. You'll
only lose maybe the first line of the headers in any case).
Since GFA is just sooooo much faster than AC-BASIC, I no longer have to
read in the usernames from your BBS into an array, the userlog is
referenced and they are obtained from that. As a result, the program
will use a HEAP less memory than before. Maybe you could even get this
to run on a 1 meg machine, now, Percy! It's worth a shot. If it
doesn't work off a main menu, try it from the doorhandler.
Another change is that if the door is run off the doorhandler, the ANSI
setting is obtained from RAM:Doordata - so whatever they have for ANSI
on the BBS will be used in the door. If the door is run off a main BBS
menu, we can't tell, so we have to ask the users. If the door IS run
off the dhandler, the user cannot change the ANSI setting, save for
quitting back to the BBS, and changing it there, then returning to the
door again!
The page-pause setting is also obtained from the BBS, and the door will
default to whatever the users have set back on the BBS.
It's trickier to change your page pause setting... in Percy's versions
of Metro you'd need to change the page-pause setting, log off, and then
call back! [Not in OzMetro, mind you]
Version 1.0 or below --> 3.0
----------------------------
If you have a version of the door below 2.0 up and running, all you need
to do is the above steps. Also, since the menu is now internal to the
code, you may DELETE these files from the door directory:
StatDoor.menu.ans
StatDoor.menu.asc
----------------------------------------------------------------------------
Files in the archive:
----------------------------------------------------------------------------
Door.exe The DOOR program itself.
Logstats Actual program run from the midnight event scripts
Logstats.doc What you're now reading.
LogstatsEd Run this BEFORE you run the stats door the first time
and also to edit the data file later.
LogstatsEd.info An icon for the editor.
Logstats.script.ex Example script file to be used for calling Logstats.
StatDoor.config File with the weightings for the Top 50 Users, and
the starting date.
Logstats.lst Source code for the program to run at midnight.
StatDoor.lst Source code for the door program.
LogstatsEd.lst Source code for the editor program.
----------------------------------------------------------------------------
Features:
----------------------------------------------------------------------------
Logstats is probably the most comprehensive stats package available for
ANY BBS system on any platform. I've been looking around, and my users
have all been patting me on the back for this one (so much so that I can
hardly type - owww my shoulder!)
Oh, I should mention the Menu is now hot-keyed, in case you miss it. It
looks for a keypress after each line of the menu is printed, and if the
key is a valid command it will execute that function. If the keypress
is NOT a valid command, it just totally ignores it.
The stat breakdowns available are:
Top Fifteens:
~~~~~~~~~~~~~
Available are listings for the top 15 users in these categories:
* Calls
* Public Messages
* Private Messages
* Downloads
* Uploads
* Door Entrances
The data output is in the following format:
---- ------ ------------------------- -------- ----- -----------
Rank User # Name Category % All Last Called
---- ------ ------------------------- -------- ----- -----------
These are self-explanatory except for perhaps the '% All', which is what
percentage of overall BBS stats this user has accounted for. For
instance, I was amazed to find that I'd posted 47.76% of the private
messages posted on my BBS since August 1990!
Overall Lists:
~~~~~~~~~~~~~~
Again, there is a list for each of these categories:
* Calls
* Public Messages
* Private Messages
* Downloads
* Uploads
* Door Entrances
The data output is in the following format:
------ ------------------------- -------- ----- -----------
User # Name Category % All Last Called
------ ------------------------- -------- ----- -----------
Ratios:
~~~~~~~
The ratio of certain things is available. It is designed to see what
sort of BBS activity each user is mainly interested in. The highest 50
ratios are sorted and output. (If there ARE 50 users to output).
For instance on my BBS only 36 users have ever uploaded a file! So the
list only gives these top 36. The others have zero uploads, so there's
no point outputing 0 Uploads per call, is there???
Ratios are available comparing:
* Public Messages }
* Private Messages }
* Uploads } <--- Per Call
* Downloads }
* Doors/Games }
If there are no stats for the users in the logstats file (for example a
new user for today who hasn't had his stats collected by the midnight
program), no value is given for the ratio. (Well, it's got a value:
zero!)
* Uploads Per Downloads
The higher the ratio the better. If the ratio is less than 1.0 they
have downloaded more files than they have uploaded.
* Public Messages Per Private Message
This is to see whether the user is more interested expressing himself
publicly or privately. I always prefer public messages, but my stat is
really low in this area. We have users on the BBS who, however, are
definite extroverts and prefer to let everyone know their problems, with
ratios of 4:1 or more!!
If no private messages have EVER been posted, no figure is given for
this user. (This doesn't happen very often, you know)!
* Downloads Per Upload
I added this to keep track of the main file leeches. If a user has
downloaded 1,000 files and uploaded 3, their ratio is going to be right
up the top. (The heading for this stat is 'Worst Downloaders!').
Yes, and I know you can't divide by zero, so if a user has downloaded
100 files and uploaded none, their ratio is given as 100 (Yeah, it's
infinity, but this doesn't allow you to see who the WORST are). For
instance someone who has downloaded 1 file (maybe the membership
application form), and uploaded none, is obviously not as bad a file
leech as someone who has downloaded 50 files for no uploads.
Don't forget, if the ratio is less than 1.0, they have uploaded more
files than they have downloaded, so the stat is not so bad.
The data output is in the following format:
---- ------ ------------------------- ------ ------ -----
Rank User # Name Thing1 Thing2 Ratio
---- ------ ------------------------- ------ ------ -----
Full Database Display:
~~~~~~~~~~~~~~~~~~~~~~
This is simply a raw database display (unsorted) for all users, for all
stats.
The data output is in the following format:
----- ------------------------- ------ ------ ------ ------ ------ -----
User# Name Calls PubMsg PriMsg DnLoad UpLoad Doors
----- ------------------------- ------ ------ ------ ------ ------ -----
Top 50 Users:
~~~~~~~~~~~~~
Here, the most active users of the BBS are given. Each of the
activities is totalled. HOWEVER, you can set weights for how important
you regard each activity in the StatDoor.config. (See later for notes
on this).
I have always been a great believer in message writing (public) as a
major BBS activity, and so the weight for public messages on my system
is a much higher value than for Door Playing. But you may disagree with
my weightings, so I've left it up to you to edit the config if you like.
If your BBS is more file oriented you will probably want to increase the
weight given to the uploads.
The data output is in the following format:
-- ----- ------------------------- ------ ------ ------ ------ ------ -----
No User# Name Calls PubMsg PriMsg DnLoad UpLoad Doors
-- ----- ------------------------- ------ ------ ------ ------ ------ -----
Any User's Stats:
~~~~~~~~~~~~~~~~~
Here are available the stored stats for each user and also the BBS
totals as a whole (yeah, I know the BBS itself isn't really a user, but
it fits into this section quite neatly. (Besides, I ran out of room on
the menu!). To get stats on the BBS, enter 'BBS' as the username.
(Weird concept, eh?)
The values given in this section go to about 5 decimal places which is a
higher order of magnitude than those figures given in the Ratios, and
other sections.
The output for the BBS Stats is like this:
Totals for <Your BBS Name as you enter into s:Metro.cfg>
Calls :
Public Messages :
Private Messages:
Downloads :
Uploads :
Games/Doors :
Public Messages Per Call :
Private Messages Per Call :
Downloads Per Call :
Uploads Per Call :
Games/Doors Per Call :
Pub Msgs Per Private Msg :
Uploads Per Download :
Then, if you want details on an individual user you may enter either the
UserNumber or UserName. The number will be located more quickly, but if
you type in the name, it will scan the list of users, and try to find a
match.
The output for each user is in the following format:
User Name :
User Number :
Date Last Called:
Calls :
Public Messages :
Private Messages:
Downloads :
Uploads :
Games/Doors :
Public Messages Per Call :
Private Messages Per Call :
Downloads Per Call :
Uploads Per Call :
Games/Doors Per Call :
Pub Msgs Per Private Msg :
Uploads Per Download :
Comprehensive, eh? I think so, too!
----------------------------------------------------------------------------
Problems & What To Do:
----------------------------------------------------------------------------
This door is a little complex to setup, however make sure you read these
docs very, very carefully if you run into troubles. I will try to make
it as simple and as clear as I possibly can. Before panicking, and
worrying why things don't run properly, investigate all the options open
to you.
If you get an error message, note what it is. Error messages will be
found in requestors, CLI windows, and GFA-BASIC alerts. If you get an
error from the LogStats program itself, it will write you a DETAILED
report in a file called BBS:BBSFiles/Logstats.errors. Look for them,
and MAKE NOTE OF THEM!
It will help if you also try to gain an idea of what was happening by
seeing what the program was doing at the time.
There's no chance of an overflow in the stats now, as GFA allows
integers of up to about 2,100,000,000!
If you are having troubles, you can write to me at my above PO Box, send
me some Fido/AmigaNet/GlobalNet netmail or even call my BBS. I will
need detailed reports on what's going on. I CAN NOT fix a problem when
you simply tell me "I can't get LogStats to work". I can. But you
can't. Why? I will need to know why, and you will have to give me
clues.
----------------------------------------------------------------------------
Setting Up - (Blank Data File)
----------------------------------------------------------------------------
Firstly let's look at how to generate a blank logstats file. If you
have been running the old version of Logstats, skip to the next section,
as you will already have a stats file in your BBSFILES directory. If
this is the case, DO NOT UNDER ANY CIRCUMSTANCES run the generator
section of the editor, unless you want to see all your old stats wiped
back to zeroes! LogstatsEd will warn you if you are about to do this.
The generator/editor for version 3.2 is now in GFA-BASIC, and has a full
workbench interface with pull down menus and the like. It's very easy
to use now, and even has online help available from the Project menu.
It's also in the vicinity of 8-10 times faster than the old version.
To generate a blank file you must run the program called LogstatsEd by
either double-clicking its icon, or typing '<path>LogstatsEd' in the
Shell.
NOTE WELL: DO NOT RUN THIS PROGRAM AT THE SAME TIME AS METRO!
There may be file conflicts. Unlikely, but if you run a BBS you never
know exactly what the users are going to do next! Logstats opens a
couple of Metro's files to get info from them, and I'd hate for someone
to login on you, just as the editor has the userlog open, or something
like that!
After LogstatsEd is running, select 'New Data File' from the Generate
menu.
After warning you about what you are going to do (ie kill all your old
stats - which is fine if you haven't got any), and warning you again if
it detects an existing data file, the program then goes through and
generates a file with zeroes in it for all the stats for all the users.
It will also create 'Logstats.oldhi'. The 'oldhi' file is the number of
users that Logstats has figures on, and so will be the same as the
'hiuser' file at the very beginning. However, if a new user then logs
in before midnight, Logstats will not have figures on him/her until the
Logstats.run program is sent to work in the midnight event. So do not
alter the 'oldhi' file.
I think that just about covers it. Real easy, really! If you have any
problems, there is online help available from the program itself.
----------------------------------------------------------------------------
Setting Up - The Door
----------------------------------------------------------------------------
You will need to set yourself up a door directory in the usual way. See
the Metro Docs for how to do this. Let's say (as an example) it's setup
as DOORFILES1/Door210.
Copy these files from the archive to that directory:
Door.exe
StatDoor.config
Door:
~~~~~
This is the actual program the BBS runs when the users select the Stats
Door from the Doors (or one of the Main BBS) Menu.
Config:
~~~~~~~
The StatDoor.config is the weighting you give to the various BBS
activities for working out the Top 50 Users. Either use mine as it
stands, or load it into an editor and simply change the NUMBERS (not the
text) in it. I worked this out over a few days, but you may decide that
a public message isn't all that important, or an upload is more
important, and so on. For safety's sake, keep the values between 0 and
9. Preferably between 0 and 5!
Here's what my config looks like:
-----
Call Weight=
4
PubMsg Weight=
5
PriMsg Weight=
2
Download Weight=
1
Upload Weight=
3
Door Weight=
2
1 August 1990
-------
Incidentally, this is also the format of the BBS:BBSFILES/logstats file:
6 numbers per line in this order, seperated by commas. One line per
user. (IE: Calls , PubMsgs , PriMsgs , DLoads , ULoads , Doors)
Please note the config file is checked extensively when being read into
the door. The left-hand 3 characters of the text lines are checked to
ensure they ARE the correct item (IE the first thing the door reads in
is the first line. It looks at the first 3 characters, converts them to
all uppercase and checks to see if it's 'CAL'. If it's not, it reports
that there is an error in the config, and aborts the door, leaving a
message in the StatDoor.errors! file. It does this for each of the
values in the config).
DON'T FORGET!! - the last line in your config now needs to be the date
you started running Logstats, so PLEASE add it in if you are upgrading
from an earlier version. If not, you'll get an 'End-of-file' error when
the door runs.
Menus:
~~~~~~
The menus make use of the IBM font, and you, too can get it running on
your Amiga globally, replacing the horrible old Topaz font that comes
standard.
What I do is have two fonts directories containing the IBM font set up.
The first one is called IBM and in it is the file '8' which is the font
itself. I leave this one well alone for the other programs to use.
The other font directory is the same, but has a different name. Let's
say it's called 'PCFont'. To get the Amiga to use this everywhere
(including with Metro) you need to simply make use of the 'FF' command
that comes on the workbench 1.3 (+) release.
In your startup-sequence, simply issue the command:
FF PCfont.font
It should then say that the Topaz font has been replaced, and warn you
that the font X or Y dimensions do not match. I don't know why it does
this, but I have been using it since the first GFA Metro version came
out, and have never had problems from any application at all. I am now
looking at a nice smooth, round font in the editor. Heaps better than
topaz ever was!
If you should ever need to access the Topaz font, it will be now
accesible as PCfont. Basically, all FF does is to swap the two types
around. (And this is why you need two IBM font directories and fonts.
Some programs do ask for the IBM.font, and if you only had 1 copy,
they'd then be using what they call ibm.font, but what the system now
calls topaz!!)
----------------------------------------------------------------------------
Setting Up - The Midnight Program
----------------------------------------------------------------------------
This is probably the tricky part, so please bear with us. The logstats
file needs to be updated regularly as new activities are carried out by
the users, and the best way to do this is a by a program run in the
midnight event.
The new version of Logstats now doesn't even open a window of its own.
All messages from this program will be sent to the CLI window you ran
Metro from.
The logstats.run in this archive is about 5 times faster than any
previous release, and actually lets you know how it's going during the
run.
There is now extensive checking for all the files the midnight program
needs to access, and if they are not where they should be the program
will abort and leave you a note. You will find the note in your
BBS:BBSFILES directory
Here are all the possible error messages from the midnight program:
------------------------------------------------------------------
Logstats midnight program recording an error!
Please rectify the situation! We couldn't access a file somewhere!
Error code was 1
Your Metro.config was not located in the s: directory.
Beats me how the BBS was running in any case!
[This one NEVER can happen under 3.4, so don't worry about it, I may
have taken it out actually, come to think of it]
------------------------------------------------------------------
Logstats midnight program recording an error!
Please rectify the situation! We couldn't access a file somewhere!
Error code was 2
You have no 'hiuser' file in the BBSFILES directory.
Any new user to login would now overwrite old users!
You will need to create a file in BBSFILES with a text editor
called 'hiuser'. This is a 1 line file with a number on it.
The number to use can be calculated by dividing the size
(in bytes) of BBSFILES/userlog by 125.
------------------------------------------------------------------
Logstats midnight program recording an error!
Please rectify the situation! We couldn't access a file somewhere!
Error code was 3
There is no 'logstats.oldhi' file in the BBSFILES directory.
I think you'll need to run the generator program on this, although
duplicating your 'hiuser' file to 'logstats.oldhi' MAY solve
this problem. Ensure that this number matches the number of lines
in the actual 'logstats' data file.
------------------------------------------------------------------
Logstats midnight program recording an error!
Please rectify the situation! We couldn't access a file somewhere!
Error code was 4
There is no 'logstats' file in the BBSFILES directory.
You will need to generate one using the generator program,
or find your backup copy and replace it.
------------------------------------------------------------------
Logstats midnight program recording an error!
Please rectify the situation! We couldn't access a file somewhere!
Error code was 5
There is no 'log' in the BBSFILES directory.
Maybe it was real quiet today, eh? In any case, no stats could
be updated, but this is not a fatal error. To get a logfile,
just log in to Metro, or ensure another script you are running
in the midnight event is NOT deleting it until AFTER you run
this program. Otherwise how else can we get to the stats??
So for frustrated users who can't get this to run, you'll now get a
detailed explanation of what file couldn't be found, and some info on
how to fix things up. Just look for 'Logstats.errors' in your BBSFILES
directory.
New for 3.3: The midnight program now takes an argument!
The usage is:
LogStats <OutputFilename>
NO inverted commas are needed (or indeed should be included) in the
output filename. Spaces are fine in BASIC filenames! Especially
considering I'm only looking for one part of the command line (the whole
thing!)
Logstats.run will now generate one more file, once it's finished with
the log. The argument you provide on the command line is the filename
the program will use. If you don't include any argument, it WON'T
produce the file.
Be careful that the argument you specify is a valid amiga filename (NOT
a directory!!). I don't check it too much, so if in doubt, don't use
it!
So, I run the program now by going:
BBS:midnight/Logstats BBS:Textfiles1/Text_505
in the logstats.script that is executed in the midnight event.
Notice the output filename was one of my textfiles? This is how I
envisage you'll use the option. The file that Logstats produced for me
when I just finished compiling V3.4 was:
---------------------------------------
Yesterday on this BBS:
---------------------------------------
1 calls were accepted,
0 public messages were posted,
0 private messages were posted,
2 doors were entered,
0 files were uploaded, and
0 files were downloaded.
---------------------------------------
Overall System Records
---------------------------------------
Most calls: 23 on 30-Oct-94
Most public messages: 30 on 16-Dec-91
Most private messages: 16 on 28-Dec-91
Most doors entered: 2 on 09-Dec-94
Most uploads: 10 on 21-Mar-92
Most downloads: 154 on 29-Jun-92
[Yes, it was the second run after I'd tested it once before and cleared
the old log file, so the figures are LOW. I also zeroed the record for
the number of doors entered just as an experiment].
Now it's clear, eh? Simply put this up as a textfile somewhere if you
like. Alternatively, set the filename to somewhere else, for your own
private perusal. If you use no argument in the call for logstats.run,
it won't produce such a file at all - just update your stats figures.
All your choice! You'll find it's much nicer running LogStats WITH a
filename, however because you get a textfile to use on the BBS, and a
set of records for your BBS thrown in for free.
----------------------------------------------------------------------------
Setting Up - Midnight Script
----------------------------------------------------------------------------
The real tricky thing, is you need to add a command to the Metro script
to run the midnight program. Okay, now start paying attention.
There are two scripts in question here. Metro's script, and the
Logstats script. Metro's script (found in the BBSFILES directory) needs
to have 1 line added to it like:
execute BBS:Midnight/logstats.script
The reason why you need to EXECUTE a seperate script, and not add
commands to Metro's script, is beacuse you cannot make use of the 'IF'
statement from a Metro script - each statement is executed separately.
So we simply 'cheat', and write our own.
The script I'm now using to run Logstats once a day looks a little like
this:
-----------
; LogStats.script 1.2
;
; By Peter Deane
;
; last updated 9 December 1994 at 5:02 am
ECHO "Running LogStats"
ECHO ""
BBS:midnight/Logstats BBS:Textfiles1/Text_505
Copy BBS:Textfiles1/Text_505 to BBS:BBSFILES/bye.asc
ECHO "LogStats completed"
ECHO ""
-----------
There is one suggestion I have, if you haven't already done it: make
yourself a directory somewhere for your midnight scripts. Then you'll
always know where to find them. Mine is called 'Midnight', and it's on
the same device as the BBSFILES directory.
If you don't want a midnight directory, you'll have to figure out some
other appropriate place to store Logstats and the script. I'm sure
you'll figure it out.
Notice that my LogStats text file is copied to the BBS:BBSFiles/bye.asc
filename. This means the screen you get when you logoff the board is
the stats file. This is completely optional - you might like your own
"bye" file better than "Yesterday on this BBS". If so, simply remove
that line. [I'm currently thinking of using the dropped carriers file
for the bye screen, incidentally :-) ]
IMPORTANT: DO *NOT* USE THE 'RUN' COMMAND TO LAUNCH LOGSTATS. JUST
ENTER IT AS AN INSTRUCTION AS SHOWN IN THE SCRIPT. EVERYTHING LATER IN
THE SCRIPT RELIES ON THIS TASK BEING FINISHED, AND IF YOU START A
SEPARATE PROCESS FOR IT WITH THE RUN COMMAND, THE NEXT COMMANDS WILL
START EXECUTING IMMEDIATELY. THIS WILL CAUSE PROBLEMS!!!
When LogStats runs, it will read you BBS:BBSFILES/Log file and collate
the statistics from it (updating its own data files), and write each
line of your old log file to a new file called BBS:BBSFiles/Log.big. It
will then delete the original "log" file to prevent double-counting of
statistics.
The Log.big file is simply a "container" for all your old logs, and it
will probably pay to do something about removing it when it gets too
big. Once every three months I arc up my old log.big file and drop it
over to floppy. You could easily automate this, but I only do it 4
times a year so it's probably not worth automating.
If you don't have a log.big file, then the first time you run logstats
you'll get one. If you DO have one, then yesterday's log is appended to
the end of it.
If you haven't been running Logstats before, you might want to feed it
your old log files so it can pull the stats out of them. To do this,
simply put your old log file(s) in BBSFiles and call them "log". Run
Logstats and it will then collect all your old stats into the stats
file, and you can then proudly say your statistics go back (some time?)
Okay, once you get this script going, I'd say you're just about set to
enjoy a trouble-free Statistical BBS for many years to come. Just
remember the author who has slaved away for hours at a time, listening
to all your comments on how to fix things up :-)
Oh, yeah, there is one more thing: The LogstatsEd does a lot more than
generate blank data files. Read on:
----------------------------------------------------------------------------
Maintenance: (in the LogstatsEd program)
----------------------------------------------------------------------------
This is the nice bit for those users who have been using Logstats for
some time. Naturally, it grew out of the need for me to do a mass-user
purge by date, something I'd been putting off for a L-O-N-G time because
I knew the Logstats files would have been all askew, and would have
needed editing by hand in a text editor.
Computer programmers are said to be lazy people, and they'd rather write
a program to do something than do it manually. Damn right!! But this
one is elegant.
Run the LogstatsEd program by entering the command in the Shell, or
double-clicking its icon. Note the warning to not run the editor and
Metro at the same time. This goes double for when you are editing
users' stats, as it needs the userlog a little more. If Metro cannot
access the userlog, it will crash. Metro needs to access the userlog
every time a user logs in and logs out. So DON'T risk it! Take the BBS
down by and pull your phone off the hook.
The new editor/generator program is designed to be 100% user-proof.
(That'll be the day!). I don't think I can get it any easier to use
now. It knows if you have or haven't got a logstats data file. If not,
it won't let you edit it. If you have, it will default to 'no' for
generating a new file - taking a conscious two mouse-clicks on two
requestors to overwrite the old one.
You'll notice a lot of ghosted menu options in LogstatsEd. This is for
possible future expansion, because it's a real pain to add menu entries
IN BETWEEN existing ones. Later...
Here are the options from within the maintenance section of the
LogstatsEd program:
Check Userlog & Clear Deleted Users
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use this option if you have done a Mass User Purge By Date. It will go
through the userlog, looking for cleared users, and set their values in
the Logstats file back to zero. All completely automatic. Need I say
more?
Yes, I do - run this STRAIGHT AWAY after doing the Mass User Delete,
before someone logs in and fills up one of the blank slots!
You can use this section as many times as you want, even if you've only
deleted 1 user. It will simply ensure that for any blank slot in your
userlog file, the corresponding logstats will be zero.
Edit One User
~~~~~~~~~~~~~
This will simply allow you to alter any of the stats for any of the
users. Once we have established which user you wish to edit, (and you
can enter the username or usernumber) then the stored stats are printed
up and you can edit these parameters:
<C>alls
<P>ublic Msgs
<S>ecret Msgs
<D>ownloads
<U>ploads
<G>ames/Doors
<R>eset ALL
<R>eset all just puts everything back to zero in one hit. It saves work
having to enter '0' for ALL the individual sections.
The keypresses are hot-keyed, and any keypress that is not C, P, S, D,
U, G, R or Q will be ignored completely.
If you enter in one of the other valid letters, you can type in a value
for it. I do absolutely NO checking on the values you enter. You can
put in numbers from -2,100 million to +2,100 million if you like. Make
sure you put in something sensible, though, please! I convert the
values to ABS() now, this will actually PREVENT you from entering
negative figures.
Note that when you enter a new value for any of the figures, the old
value is presented on the input line for you to edit. Don't forget!
Remember to delete the parts of the old value you are changing.
When you have finished altering the values, select <Q>uit and you will
be asked one question: "Commit these changes to Disk?" If you want to
back out now, then that's fine. The changes you made will disappear
like a re-initialised array. If not, then the whole logstats file will
be saved out to disk, and you can return for more editing if you wish.
(This is where GFA would came to the rescue - it used to take a while to
drop out the entire stats file - GFA now makes real short work of it).
----------------------------------------------------------------------------
The main points again:
----------------------------------------------------------------------------
* The Door program is a normal OzMetro door, set it up as usual. It
needs a StatDoor.config file in the door directory with it.
* BEFORE you run Logstats or the Stat Door, use LogStatsEd to generate a
blank data file. Without one, WEIRD things will happen.
* Logstats needs to be run once a day in the Midnight Event (from the
BBS:BBSFiles/Script file).
* Logstats will now remove your old log file for you automatically (so
users of old versions may have to update their invocation scripts).
----------------------------------------------------------------------------
Bye!
----------------------------------------------------------------------------